<template>
  <svg
    aria-hidden="true"
    class="svg-icon"
    :style="{ width: width, height: height }"
  >
    <use :xlink:href="symbolId" :fill="color"></use>
  </svg>
</template>

<script setup lang="ts">
import { defineProps, computed } from "vue";

const props = defineProps({
  prefix: { type: String, default: "icon" },
  iconClass: { type: String, required: true },
  color: { type: String, default: "" },
  width: { type: String, default: "0.1rem" },
  height: { type: String, default: "0.1rem" },
});

const symbolId = computed(() => `#${props.prefix}-${props.iconClass}`);
</script>

<style scoped>
.svg-icon {
  vertical-align: -0.15em;
  overflow: hidden;
  fill: currentColor;
  cursor:pointer;
}
</style>
